package com.fary.converters;

import com.fary.po.Person;
import org.springframework.core.convert.converter.Converter;

public class MyConverter implements Converter<String, Person> {

    @Override
    public Person convert(String source) {
        System.out.println("----------------------"+source+"---------------");
        String[] split = source.split("-");
        return new Person(split[0], Integer.parseInt(split[1]));
    }

}
